import request from '@/utils/request'

export function getList(params) {
  return request({
    url: '/api/bookstore2/questionAndAnswerPosts',
    method: 'get',
    params
  })
}

export function getById(id) {
  return request({
    url: '/api/bookstore2/questionAndAnswerPosts/' + id,
    method: 'get'
  })
}

export function create(dto) {
  return request({
    url: '/api/bookstore2/questionAndAnswerPosts',
    method: 'post',
    data: dto
  })
}

export function edit(id, dto) {
  return request({
    url: '/api/bookstore2/questionAndAnswerPosts/' + id,
    method: 'put',
    data: dto
  })
}

export function deleteById(id) {
  return request({
    url: '/api/bookstore2/questionAndAnswerPosts/' + id,
    method: 'delete'
  })
}
